import VueRouter from 'vue-router'
const router = new  VueRouter({
    mode:'history',
    routes:[
        {
            path:'/',
            redirect:'/login'
        },
        {
            name:'login',
            path:'/login',
            component:() =>import (/* webpackChunkName: "about" */ '../pages/Login'),
        },
        {
            name:'admin',
            path:'/admin',
            component:() =>import (/* webpackChunkName: "about" */ '../pages/Admin'),
            redirect: "/home",
            children:[
        
                {
                    name:'home',
                    path:'home',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Home'),
                    meta:{
                        title:'首页'
                    }
                },
                {
                    name:'users',
                    path:'users',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/User/UserList'),
                    meta:{
                        title:'用户列表'
                    }
                },
                {
                    name:'roles',
                    path:'roles',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Authorization/RoleList'),
                    meta:{
                        title:'角色列表'
                    }
                },
                {
                    name:'rights',
                    path:'rights',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Authorization/Rmanagement'),
                    meta:{
                        title:'权限列表'
                    }
                },
               
                {
                    name:'goods',
                    path:'goods',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Goods/GoodsList'),
                    meta:{
                        title:'商品列表'
                    }
                },
                {
                    name:'add',
                    path:'add',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Goods/AddGoods'),
                    meta:{
                        title:'添加商品'
                    }
                },
                {
                    name:'params',
                    path:'params',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Goods/GoodsNum'),
                    meta:{
                        title:'分类参数'
                    }
                },
                {
                    name:'categories',
                    path:'categories',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Goods/GoodsCategories'),
                    meta:{
                        title:'商品分类'
                    }
                },
                {
                    name:'orders',
                    path:'orders',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/Order/OrderList'),
                    meta:{
                        title:'订单列表'
                    }
                },
                {
                    name:'reports',
                    path:'reports',
                    component:() => import (/* webpackChunkName: "about" */ '../pages/StatsData/DataGram'),
                    meta:{
                        title:'数据报表'
                    }
                },
               
            ]
        }
    ]
})

export default router